<template>
    <div>

        <el-date-picker
                v-model="value1"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期">
        </el-date-picker>
        <el-button @click="hh"></el-button>
        <!--dgsahdghasjd
        {{ message }}
        <input v-model="mes"/>
        <p>{{mes}}</p>
        <div>
            #############
        </div>-->
        <div>
            {{UserList}}
        </div>

        <div class="sg-qrcode">
            <vue-qr :text="qrcodeText"
                    :correctLevel="3"
                    :size="250"
                    :margin="10"
                    colorDark="#f8d000"
                    colorLight="white"
                    backgroundColor="white"
                    backgroundDimming="white"
                    :logoScale=".2"
                    :logoMargin="5"
                    logoBackgroundColor="white"
            ></vue-qr>
        </div>
    </div>
</template>

<script>
    import vueQr from "vue-qr";

    export default {
        name: "ceshi",
        data() {
            return {
                value1: '',

                message: "helloworld",
                mes: "",
                UserList: [],

                qrcodeText: "舒工请你付款来了", //二维码内容（扫码识别后需要访问的网址）
            }
        },
        components: {
            vueQr //二维码生成组件
        },
        /*mounted:function(){
            console.log("hhhh")
            this.getAllUser();
        },*/
        /*created() {
            this.getAllUser();
        },*/
        created() {
            this.getAllUser()
        },
        methods: {
            hh(){
                console.log(this.value1)
            },
            async getAllUser() {
                console.log("执行了getAllUser");
                const {data: res_j} = await this.$http.get("getAllUser");
                // var res = JSON.parse(res_j);
                console.log(res_j);
                //console.log(res);
                this.UserList = res_j.UserList
            },
            mounted() {
                let _this = this;//赋值vue的this
                window.onresize = () => {
                    //调用methods中的事件
                    _this.pageResize();
                }
            },
            //注销window.onresize事件
            destroyed() {
                window.onresize = null;
            }
        }
    }
</script>

<style scoped>

</style>

